package com.object.module.cbb.frontEnd;

import com.object.configuration.utils.PageUtils;
import com.object.configuration.utils.Q;
import com.object.module.cbb.entity.CbbOrderEntity;
import com.object.module.cbb.entity.CbbSortEntity;
import com.object.module.cbb.service.CbbSortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;
import java.util.Map;


/**
 * 商品分类表
 *
 * @author 小🌤
 * @email 1578442339@qq.com
 * @date 2021-12-29 21:06:27
 */
@RestController
@RequestMapping("/frontend/sort")
public class FrontEndCbbSortController {
    @Autowired
    private CbbSortService cbbSortService;


    /**
     * 查询全部分类
     */
    @GetMapping("/all")
    public Q all() {
        List<CbbSortEntity> list = cbbSortService.listAll();
        return Q.ok().put("data", list);
    }



    /**
     * 信息
     */
    @RequestMapping("/info/{stId}")
    public Q info(@PathVariable("stId") Integer stId) {
            CbbSortEntity cbbSort = cbbSortService.getById(stId);
            return Q.ok().put("cbbSort", cbbSort);
    }





}
